package com.xawl.service.impl;

import com.xawl.dao.MessageMapper;
import com.xawl.pojo.Message;
import com.xawl.service.MessageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

@Service
public class MessageServiceImpl implements MessageService {

    @Autowired
    MessageMapper messageMapper;

    public Integer getTotal() {
        return messageMapper.getTotal();
    }

    public int addMessage(Message message) {
        return messageMapper.addMessage(message);
    }

    public int deleteMessage(int m_id) {
        return messageMapper.deleteMessage(m_id);
    }

    @Override
    public int deleteMessages(Long[] ids) {
        return messageMapper.deleteMessages(ids);
    }

    @Override
    public Message findMessageById(int id) {
        return messageMapper.findMessageById(id);
    }

    @Override
    public List<Message> queryAll() {
        return messageMapper.queryAll();
    }

    public int updateMessage(Message message) {
        return messageMapper.updateMessage(message);
    }

}
